<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
        <title>Welcome to Design Zone......</title>
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
        <script type="text/javascript" src="../../scripts/ext/adapter/ext-base.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/EditableItem.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/RangeMenu.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/GridFilters.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/Filter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/StringFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/ListFilter.js">
        </script>
		<script type="text/javascript" src="../../scripts/grid/filter/DateFilter.js"></script>
		<script type="text/javascript" src="../../scripts/grid/RowExpander.js">
        </script>
        <script type="text/javascript" src="../../scripts/i18nMessage.js">
        </script>
        <script type="text/javascript" src="../../scripts/utils.js">
        </script>
        <script type="text/javascript">
        	var piMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.productidentification');
			var referenceMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.reference');
			var colorMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.pantonecolor');
			var fcMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
			var fMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.factory');
            var message = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=message');
			
            var ctDesignTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtDesignType');
            var ctMachineTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtMachineType');
            var ctCollarTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtCollarType');
			var ctVersionXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtVersion');
			var ctSeasonNumberXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtSeasonNumber');
			var ctProductFamilyXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtProductFamily');
			var customerXmlLoader = new xmlLoader('../../servlet/BiFranceCustomerServlet?action=5');
            
            var ctDesignTypeStore;
            var ctMachineTypeStore;
            var ctCollarTypeStore;
			var ctVersionStore;
			var ctSeasonNumberStore;
			var ctProductFamilyStore;
			var customerStore;			
            
            var ctDesignTypeCombo;
            var ctMachineTypeCombo;
            var ctCollarTypeCombo;
			var ctProductFamilyCombo;
			var ctVersionCombo;
			var ctSeasonNumberCombo;
			var customerCombo;
			
			
			var store;
            var grid;
			var piPanel;
			
			var deleteCallback = function(btn){
                if (btn == 'yes') {
                    Ext.Ajax.request({
                        url: '../../servlet/ProductIdentificationServlet?action=2&id=' + deleteId,
                        success: function(o){
                            if (o.responseText == 'success') {
                                store.reload();
                                messageTip.msg(message.get('message.tip'), message.get('message.delete.successful'));
                            }
                            else {
                                messageTip.msg(message.get('message.tip'), message.get('message.delete.unsuccessful'));
                            }
                        },
                        failure: function(o){
                            messageTip.msg(message.get('message.tip'), message.get('message.delete.failure'));
                        },
                        params: {
                            foo: 'bar'
                        }
                    });
                }
            }
			
			var filter = function(){
				var itemIndex = 0;
				if(store.getAt(0) && store.getAt(0).data){
					itemIndex = store.getAt(0).data.index - 1;
				}
				store.load({
                    params: {
						start: itemIndex
                    }
                });
			}
			
			Ext.onReady(function(){
                // create the Data Store
                ctDesignTypeStore = new Ext.data.Store({
                
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, ['code', 'description']),
                    data: ctDesignTypeXmlLoader.getXml()
                });
				ctDesignTypeStore.insert(0, blankRecord);
                
                ctMachineTypeStore = new Ext.data.Store({
                
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, ['code', 'description']),
                    data: ctMachineTypeXmlLoader.getXml()
                });
				ctMachineTypeStore.insert(0, blankRecord);
                
                ctCollarTypeStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctCollarTypeXmlLoader.getXml()
                });
				ctCollarTypeStore.insert(0, blankRecord);
				
				ctVersionStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctVersionXmlLoader.getXml()
                });
				ctVersionStore.insert(0, blankRecord);
				
				ctSeasonNumberStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctSeasonNumberXmlLoader.getXml()
                });
				ctSeasonNumberStore.insert(0, blankRecord);
				
				ctProductFamilyStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'code', 'description']),
					data: ctProductFamilyXmlLoader.getXml()
                });
				ctProductFamilyStore.insert(0, blankRecord);
				
				customerStore = new Ext.data.Store({
	                reader: new Ext.data.XmlReader({
	                    record: 'item',
	                    id: 'id',
	                    totalRecords: 'itemTotal'
	                }, ['id', 'name', 'department']),
	                data: customerXmlLoader.getXml()
	            });
				customerStore.insert(0, blankRecord);
                
                ctDesignTypeCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.designtype'),
                    id: 'ctDesignType',
                    name: 'ctDesignType',
                    anchor: '90%',
					width: '90%',
                    valueField: 'code',
                    typeAhead: true,
                    store: ctDesignTypeStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
                });
                
                ctCollarTypeCombo = new Ext.form.ComboBox({
					fieldLabel: message.get('message.edit.collar'),
					id: 'ctCollarType',
					name: 'ctCollarType',
					anchor: '90%',
					width: '90%',
					editable: false,
				    store: ctCollarTypeStore,
					valueField: 'code',
				    displayField:'description',
				    triggerAction: 'all',
				    emptyText: message.get('message.combo.pleaseselect'),
				    selectOnFocus:true,
					mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
				});
                
                ctMachineTypeCombo = new Ext.form.ComboBox({
                    fieldLabel: referenceMessage.get('ui.reference.machinetype'),
                    id: 'ctMachineType',
                    name: 'ctMachineType',
                    anchor: '90%',
					width: '90%',
                    valueField: 'code',
                    typeAhead: true,
                    store: ctMachineTypeStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
                });
                
				ctVersionCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.chartversion'),
                    id: 'ctVersion',
                    name: 'ctVersion',
                    anchor: '90%',
					width: '90%',
                    valueField: 'code',
                    typeAhead: true,
                    store: ctVersionStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
                });
				
				ctSeasonNumberCombo = new Ext.form.ComboBox({
                    fieldLabel: piMessage.get('ui.productidentification.seasonnumber'),
                    id: 'ctSeasonNumber',
                    name: 'ctSeasonNumber',
                    anchor: '90%',
					width: '90%',
                    valueField: 'code',
                    typeAhead: true,
                    store: ctSeasonNumberStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
                });
				
				ctProductFamilyCombo = new Ext.form.ComboBox({
                    fieldLabel: message.get('message.edit.productfamily'),
                    id: 'ctProductFamily',
                    name: 'ctProductFamily',
                    valueField: 'code',
                    typeAhead: true,
                    store: ctProductFamilyStore,
                    displayField: 'description',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    mode: 'local',
					anchor: '90%',
					width: '90%',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
                });
				
				customerCombo = new Ext.form.ComboBox({
                    fieldLabel: message.get('message.edit.customername'),
                    id: 'customerId',
                    name: 'customerId',
                    tpl: '<tpl for="."><div class="x-combo-list-item">{name}&nbsp;&nbsp;--&nbsp;&nbsp;{department}</div></tpl>',
                    valueField: 'id',
                    typeAhead: true,
                    store: customerStore,
                    displayField: 'name',
                    forceSelection: true,
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
					anchor: '90%',
					width: '90%',
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisComb, record,index){
								filter();
							}
						}
					}
                });
                
                store = new Ext.data.Store({
                    url: '../../servlet/ProductIdentificationServlet?action=102',
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'id',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'index', 'id', 'ctProductFamily', 'biMeasureSpecificationId',
					'ctMachineType', 'type', 'orderNumber',
					 'yarnNumber', 'dhlNumber', 'ctDesignType',
					 'style', 'customerLinkman', 'model', 
					 'ctSeasonNumber', 'createDate', 'reference',
					 'ctVersion', 'patronageNumer', 'front', 
					 'back', 'sleeves', 'bottomThrum', 
					 'sleevesThrum', 'necklineThrum', 'needle', 
					 'weight', 'comment', 'photoName', 'frontPhotoName','backPhotoName','otherPhotoName',
					 'chartName', 'modifyDate', 
					 'isSimilary', 'isNewfashioned', 'isDifficulty', 
					 'dhlNumber', {name: 'biFranceCustomer.name', mapping: 'customerName'},
					 {name: 'biFranceCustomer.department', mapping: 'customerDepartment'},'isTagged','isYarned', 'isOrdered', 'isButtoned', 'isZipped', 'isAo']),
                    
                    remoteSort: true,
					listeners: {
						beforeload: {
							fn: function(thisStore, options){
								var filterIndex = 0;
								if(ctDesignTypeCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = ctDesignTypeCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'ctDesignType';
									filterIndex ++;
								}
								
								if(ctMachineTypeCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = ctMachineTypeCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'ctMachineType';
									filterIndex ++;
								}
								
								if(ctCollarTypeCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = ctCollarTypeCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'ctCollarType';
									filterIndex ++;
								}
								
								if(ctProductFamilyCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = ctProductFamilyCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'ctProductFamily';
									filterIndex ++;
								}
								
								if(ctVersionCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = ctVersionCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'ctVersion';
									filterIndex ++;
								}
								
								if(ctSeasonNumberCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = ctSeasonNumberCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'ctSeasonNumber';
									filterIndex ++;
								}
								
								if(customerCombo.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = customerCombo.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'biFranceCustomer.id';
									filterIndex ++;
								}
								
								var referenceFilter = Ext.getCmp('reference');
								if(referenceFilter.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = referenceFilter.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'reference';
									filterIndex ++;
								}
								
								var patronageNumerFilter = Ext.getCmp('patronageNumer');
								if(patronageNumerFilter.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'string';
									options['params']['filter[' + filterIndex + '][data][value]'] = patronageNumerFilter.getValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'patronageNumer';
									filterIndex ++;
								}
								
								var createDate1Filter = Ext.getCmp('createDate1');
								if(createDate1Filter.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'date';
									options['params']['filter[' + filterIndex + '][data][value]'] = createDate1Filter.getRawValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'createDate';
									options['params']['filter[' + filterIndex + '][data][comparison]'] = 'gt';
									filterIndex ++;
								}
								
								var createDate2Filter = Ext.getCmp('createDate2');
								if(createDate2Filter.getValue() != ''){
									options['params']['filter[' + filterIndex + '][data][type]'] = 'date';
									options['params']['filter[' + filterIndex + '][data][value]'] = createDate2Filter.getRawValue();
									options['params']['filter[' + filterIndex + '][field]'] = 'createDate';
									options['params']['filter[' + filterIndex + '][data][comparison]'] = 'lt';
									filterIndex ++;
								}
								
								
								if(filterIndex == 0){
									return false;
								}
								return true;
							}
						}
					}
                });
			
				store.setDefaultSort('id', 'desc');
												
				var expander = new Ext.grid.RowExpander({
			        tpl : new Ext.Template(
						'<p><b>' + piMessage.get('ui.productidentification.ordernumber') + ':</b> {orderNumber} &nbsp;&nbsp;&nbsp;&nbsp;<b>' + piMessage.get('ui.productidentification.dhl') + ':</b> {dhlNumber} &nbsp;&nbsp;&nbsp;&nbsp;</p><br/>',
			            '<p><b>' + referenceMessage.get('ui.reference.front') + ':</b> {front} &nbsp;&nbsp;&nbsp;&nbsp; <b>' + referenceMessage.get('ui.reference.back') + ':</b> {back}&nbsp;&nbsp;&nbsp;&nbsp;',
						'<b>' + referenceMessage.get('ui.reference.sleeves') + ':</b> {sleeves} &nbsp;&nbsp;&nbsp;&nbsp; <b>' + referenceMessage.get('ui.reference.bottomthrum') + ':</b> {bottomThrum}&nbsp;&nbsp;&nbsp;&nbsp;',
						'<b>' + referenceMessage.get('ui.reference.sleevesthrum') + ':</b> {sleevesThrum} &nbsp;&nbsp;&nbsp;&nbsp; <b>' + referenceMessage.get('ui.reference.necklinethrum') + ':</b> {necklineThrum}&nbsp;&nbsp;&nbsp;&nbsp;</p><br/>',
			            '<p><b>' + referenceMessage.get('ui.reference.needle') + ':</b> {needle} &nbsp;&nbsp;&nbsp;&nbsp; <b>' + referenceMessage.get('ui.reference.machinetype') + ':</b> {ctMachineType}&nbsp;&nbsp;&nbsp;&nbsp;',
						'<b>' + referenceMessage.get('ui.reference.weight') + ':</b> {weight} &nbsp;&nbsp;&nbsp;&nbsp; <b>',// + piMessage.get('ui.productidentification.yarnnumber') + ':</b> {yarnNumber}&nbsp;&nbsp;&nbsp;&nbsp;',
						'</p><br/>',
						'<p><img src="../../_temp/{chartName}" width="150px"/> &nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{photoName}" width="150px"/>',
						//&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{frontPhotoName}" width="150px"/>&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{backPhotoName}" width="150px"/>&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{otherPhotoName}" width="150px"/></p><br/>',
						'<br/><br/><p><b>' + piMessage.get('ui.productidentification.comment') + ':</b> {comment}</p><br/>'
			        )
			    });
				
				grid = new Ext.grid.GridPanel({
                    store: store,
					stripeRows: true,
					plugins: [expander],
                    height: 560,
                    columns: [expander, {
                        header: message.get('message.list.id'),
                        width: 50,
                        dataIndex: 'index',
                        sortable: false
                    }, {
                        header: fcMessage.get('ui.francecustomer.name'),
                        dataIndex: 'biFranceCustomer.name',
                        sortable: true
                    }, {
                        header: fcMessage.get('ui.francecustomer.department'),
                        dataIndex: 'biFranceCustomer.department',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.style'),
                        dataIndex: 'style',
                        sortable: true
                    },{
                        header: message.get('message.edit.productfamily'),
                        dataIndex: 'ctProductFamily',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.designtype'),
                        dataIndex: 'ctDesignType',
                        sortable: true
                    },{
                        header: referenceMessage.get('ui.reference.reference'),
                        dataIndex: 'reference',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.seasonnumber'),
                        dataIndex: 'ctSeasonNumber',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.model'),
                        dataIndex: 'model',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.chartversion'),
                        dataIndex: 'ctVersion',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.patronagenumer'),
                        dataIndex: 'patronageNumer',
                        sortable: true
                    },{
                        header: message.get('message.edit.createdate'),
                        dataIndex: 'createDate',
                        sortable: true
                    },{
                        header: message.get('message.edit.modifydate'),
                        dataIndex: 'modifyDate',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.measurespecification'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderEditItem
                    },{
                        header: piMessage.get('ui.productidentification.tag'),
                        width: 50,
                        dataIndex: 'isTagged',
                        sortable: false,
                        renderer: renderTag
                    },{
                        header: message.get('message.list.order'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderOrder
                    },{
                        header: piMessage.get('ui.productidentification.yarn'),
                        width: 50,
                        dataIndex: 'isYarned',
                        sortable: false,
                        renderer: renderYarn
                    },{
                        header: piMessage.get('ui.productidentification.button'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderButton
                    },{
                        header: piMessage.get('ui.productidentification.zip'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderZip
                    },{
                        header: piMessage.get('ui.productidentification.accessory'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderAccessory
                    },{
                        header: piMessage.get('ui.productidentification.upgrade'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderUpgrade
                    },{
                        header: message.get('message.edit.output'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderReport
                    },{
                        header: message.get('message.list.eidt'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderEdit
                    },{
                        header: message.get('message.list.delete'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderDelete
                    }],
                    viewConfig: {
                        forceFit: true
                    },
                    loadMask: true,
                    bbar: new Ext.PagingToolbar({
                        pageSize: 20,
                        store: store,
                        displayInfo: true
                    })
                });
				
				new Ext.Panel({
			        id:'piPanel',
			        frame:true,
			        width:'100%',
					labelWidth: 105,
			        collapsible:true,
			        title: piMessage.get('ui.productidentification.search'),
			        items: [{
								layout: 'column',
								items: [{
									columnWidth:.25,
					                layout: 'form',
									items: [ctProductFamilyCombo, customerCombo,{
										id: 'createDate1',
	                                    name: 'createDate1',
	                                    fieldLabel: message.get('message.edit.createdate') + '<b>(d/m/Y)&nbsp;&gt;&nbsp;</b>',
	                                    xtype: 'datefield',
	                                    anchor: '86%',
										width: '90%',
	                                    maxLength: 64,
				                    	listeners: {
				                    		'render': {fn:function(){
										    	Ext.getCmp('createDate1').getEl().on('focus', function(){
										    		filter();
										    	}, this, {buffer:500});
				                    		}, scope:this}
				                    	}		
	                                }]
								},{
									columnWidth:.25,
					                layout: 'form',
									items: [ctDesignTypeCombo, {
	                                    name: 'reference',
										id: 'reference',
	                                    fieldLabel: referenceMessage.get('ui.reference.reference'),
	                                    xtype: 'textfield',
	                                    anchor: '90%',
										width: '90%',
	                                    maxLength: 64,
	                                    listeners: {
				                    		'render': {fn:function(){
										    	Ext.getCmp('reference').getEl().on('keyup', function(){
										    		filter();
										    	}, this, {buffer:500});
				                    		}, scope:this}
				                    	}	
	                                },{
										id: 'createDate2',
	                                    name: 'createDate2',
	                                    fieldLabel: message.get('message.edit.createdate') + '<b>(d/m/Y)&nbsp;&lt;&nbsp;</b>',
	                                    xtype: 'datefield',
	                                    anchor: '86%',
										width: '90%',
	                                    maxLength: 64,
				                    	listeners: {
				                    		'render': {fn:function(){
										    	Ext.getCmp('createDate2').getEl().on('focus', function(){
										    		filter();
										    	}, this, {buffer:500});
				                    		}, scope:this}
				                    	}		
	                                }]
								},{
									columnWidth:.25,
					                layout: 'form',
									items: [ctSeasonNumberCombo,{
										id: 'patronageNumer',
	                                    name: 'patronageNumer',
	                                    fieldLabel: piMessage.get('ui.productidentification.patronagenumer'),
	                                    xtype: 'textfield',
	                                    anchor: '90%',
										width: '90%',
	                                    maxLength: 64,
				                    	listeners: {
				                    		'render': {fn:function(){
										    	Ext.getCmp('patronageNumer').getEl().on('keyup', function(){
										    		filter();
										    	}, this, {buffer:500});
				                    		}, scope:this}
				                    	}		
	                                },ctMachineTypeCombo]
								},{
									columnWidth:.25,
					                layout: 'form',
									items: [ctCollarTypeCombo, ctVersionCombo]
								}]
	                    	},grid],
			        renderTo: 'productIdentificationPanel'
			    });
                                		
				function renderEditItem(value, p, record){
					return String.format('<a href="product_measure_specification_item_edit.html?id={0}&msId={1}&startPage={2}" target="_self"><img src="../../images/icons/sitemap_color.png" title="' + piMessage.get('ui.productidentification.measurespecification') + message.get('message.list.eidtitem') + '" /></a>', record.id, record.data.biMeasureSpecificationId,  Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderOrder(value, p, record){
					if(record.data.isOrdered == 1)
                    	return String.format('<a href="product_identification_order_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/table.png" title="' + message.get('message.list.order') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					else
						return String.format('<a href="product_identification_order_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/table.png" title="' + message.get('message.list.order') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderTag(value, p, record){
					if(record.data.isTagged == 1)
                    	return String.format('<a href="product_identification_tag_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/tag_blue_add.png" title="' + piMessage.get('ui.productidentification.tag') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					else 
						return String.format('<a href="product_identification_tag_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/tag_blue_add.png" title="' + piMessage.get('ui.productidentification.tag') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderButton(value, p, record){
					if(record.data.isButtoned == 1)
                    	return String.format('<a href="product_identification_button_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/sport_golf.png" title="' + message.get('message.action.button') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                	else 
						return String.format('<a href="product_identification_button_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/sport_golf.png" title="' + message.get('message.action.button') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderZip(value, p, record){
					if(record.data.isZipped == 1)
                    	return String.format('<a href="product_identification_zip_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/link.png" title="' + message.get('message.action.zip') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                	else 
						return String.format('<a href="product_identification_zip_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/link.png" title="' + message.get('message.action.zip') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderAccessory(value, p, record){
					if(record.data.isAo == 1)
                    	return String.format('<a href="product_identification_accessory_others_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/bricks.png" title="' + message.get('message.action.accessoryothers') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                	else 
						return String.format('<a href="product_identification_accessory_others_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/bricks.png" title="' + message.get('message.action.accessoryothers') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
                function renderYarn(value, p, record){
					if(record.data.isYarned == 1)
                    	return String.format('<a href="product_identification_yarn_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/shading.png" title="' + piMessage.get('ui.productidentification.yarn') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					else
						return String.format('<a href="product_identification_yarn_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/shading.png" title="' + piMessage.get('ui.productidentification.yarn') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderColor(value, p, record){
                    return String.format('<a href="" target="_self"><img src="../../images/icons/color_wheel.png" title="' + piMessage.get('ui.productidentification.color') + '" /></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderUpgrade(value, p, record){
					return String.format('<a href="product_identification_edit.html?id={0}&version={1}&startPage={2}" target="_self"><img src="../../images/icons/arrow_up.png" title="' + piMessage.get('ui.productidentification.upgrade') + '" /></a>', record.id, record.data.ctVersion, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderReport(value, p, record){
					return String.format('<a href="product_identification_report.jsp?id={0}" target="_blank"><img src="../../images/icons/report.png" title="' + message.get('message.edit.output') + '" /></a>', record.id);
				}
				
				function renderEdit(value, p, record){
                    return String.format('<a href="product_identification_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/pencil.png" title="' + message.get('message.list.eidt') + '" /></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
                
                function renderDelete(value, p, record){
                    return String.format('<a href="javascript: deleteItem(deleteCallback, {0});"><img src="../../images/icons/delete.png" title="' + message.get('message.list.delete') + '"/></a>', record.id);
                }

			});
        
        </script>
    </head>
    <body>
    		<div id="productIdentificationPanel"></div>
    </body>
</html>
